from flask import jsonify

def response_json(data=None, msg="success", code=200):
    """
    成功返回
    """
    return jsonify({
        "msg": msg,
        "code": code,
        "data": data
    })


def response_error(msg="fail", code=400, data=None):
    """
    错误返回
    """
    return jsonify({
        "msg": msg,
        "code": code,
        "data": data
    })
